package com.wtwd.campus.h5_manager.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.campus.h5_manager.entity.H5Customer;
import com.wtwd.campus.h5_manager.entity.vo.H5CustomerVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author mjy
 * @since 2022-03-07
 */
public interface H5CustomerService {

    H5Customer getH5CustomerById(int id);

    H5Customer getH5CustomerByName(String name);

    Integer addCustomer(H5Customer h5Customer);

    IPage<H5CustomerVo> queryCustomerPage(Map<String, Object> searchMap, Page<H5CustomerVo> page);


    /**
     * 鉴别客户名称是否已经存在
     * 存在客户id时会排除自己本身然后鉴别
     * <p>
     * 存在?false:true
     *
     * @param
     * @return
     */
    Boolean authCustomerName(H5CustomerVo h5CustomerVo);

    Integer updateCustomerById(H5Customer customer);

    /**
     * 删除客户时删除，客户拥有的角色,以及该客户下所有的账号
     * 同时删除，菜单权限表中记录
     *
     * @param customerId
     * @return
     */
    Integer deleteById(Integer customerId);

    /**
     * 根据客户id查询客户
     * 如果客户id是总部(10)则查询所有
     *
     * @param customerId
     * @return
     */
    List<H5Customer> queryCustomer(Integer customerId);
}
